﻿using Pay.DTO;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.IService
{
    public interface IConsumeItemService
    {
        #region 后台管理
        #region 消费项目
        /// <summary>
        /// 获得消费项目列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<consume_item_dto> GetConsumeItems(ConsumeItemQuery query);

        /// <summary>
        /// 获得消费项目
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        consume_item_dto GetConsumeItem(long id);

        /// <summary>
        /// 新增消费项目
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultMessage<int> AddConsumeItem(consume_item_dto dto);

        /// <summary>
        /// 更新消费项目
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResultMessage<int> UpdateConsumeItem(consume_item_dto dto);

        /// <summary>
        /// 修改消费项目状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateDisabled(long id, int isDisabled);
        #endregion

        #region 消费-商品兑换
        /// <summary>
        /// 获得消费商品列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<consume_product_dto> GetConsumeProducts(ConsumeProductQuery query);
        /// <summary>
        /// 获得消费商品
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        consume_product_dto GetConsumeProduct(long id);
        /// <summary>
        /// 新增消费商品
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        int AddConsumeProduct(consume_product_dto dto);
        /// <summary>
        /// 更新消费商品
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        int UpdateConsumeProduct(consume_product_dto dto);
        /// <summary>
        /// 修改消费商品状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateConsumeProductStatus(long id, int status);
        #endregion

        #region 消费记录
        /// <summary>
        /// 用户消费记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<user_comsume_his_dto_ex> GetUserComsumeHiss(UserComsumeHisQuery query);
        /// <summary>
        /// 修改用户消费记录状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateUserComsumeHisStatus(long id, int status);
        #endregion
        #endregion

        #region APP
        /// <summary>
        /// App获得项目消费列表
        /// </summary>
        /// <returns></returns>
        List<app_consume_item_dto> AppGetConsumeItemList();
        List<app_consume_item_dto> AppGetConsumeItemList(ConsumeQuery query);
        /// <summary>
        /// App获得商品兑换 商品分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<app_consume_product_dto> AppConsumeProductPageList(PageQuery query);
        /// <summary>
        /// App根据商品Id 获得商品
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        app_consume_product_dto AppGetComsumeProduct(long productId);
        /// <summary>
        /// App 商品兑换
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="productId"></param>
        /// <param name="red_drill">前端显示所需红钻,若后台变更,和前端显示不一致,提醒用户刷新</param>
        /// <returns></returns>
        bool AppExchangeProduct(long userId, long productId, decimal red_drill, long? shipAddressId);
        /// <summary>
        /// App获得用户兑换列表
        /// </summary>
        /// <param name="query"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        PagedResult<user_exchange_product_his_dto> AppGetUserExchangeProductHis(PageQuery query, long userId);
        #endregion
    }
}
